//
//  PanelNumberImageDBModel.swift
//  ezyform
//
//  Created by MoennigQ on 15/5/18.
//  Copyright © 2018 Client.Solution Pty Ltd. All rights reserved.
//

import UIKit
import HandyJSON
enum PanelNumberSPVStatus: String{
    case invalid = "invalid"
    case verified = "verified"
    case unverified = "unverified"
    case verifying = "verifying"
    case all = ""
}
class PanelNumberImageDBModel: HandyJSON{
    var dbId: Int32 = 0
    
    var pvd_id: String = ""
    
    var id: String = ""//image id from server
    
    var original_code: String = ""//最初的原始值
    
    var code: String = ""//可能在在未上传前本地修改过，或上传后修改过
    
    var image: String = ""//图片链接地址
    var imageData: Data?
    
    var latitude: Double?
    
    var longitude: Double?
    
    var removed: Int?
    
    var uploading_flag: String = ""
    
    var record_at: String = ""
    
    var operType: String = "" //A: 新增，D: 删除， M：表示修改
    
    var auto_scan: Int32 = 1 //0:手工增加，1：扫描增加
    var scan_type: Int32 = 0 //1:Dynamsoft扫描库识别，2：原生扫描库识别; 0:代表是手动增加，后台增加，还有retailer加的
    
    var spv_status: String = ""//四个状态：invalid, verified, unverified(网络不好或第三方api调用失败), verifying
    
    var barcode_type: String = ""//记录是什么类型的barcode，例如：UPC_E, EAN-8, EAN-13, QRCode等等
    
    //spv job如果此panel number verified会显示相应的model和brand
    var brand: String = ""
    var model: String = ""
    var error_history_message_type: String = ""//对应JobErrorModel中的message_type
    var error_history_message: String = ""
    //扫码置信度，范围是0~100，默认是0
    var confidence: Int32 = 0
    //扫描的识别时间，单位是毫秒
    var scan_timespan: Int32 = 0
    //invalid reason,spv 的panel没有验证通过的原因
    var spv_error_message: String = ""
    var validFlag: Bool = true
    required init(){}
}
